<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2017/10/13
 * Time: 9:24
 */
namespace   Android\Model;
use Think\Model;

class ShopModel extends Model{
    function shopdetails(&$shopid){
        $info=M('shop');
        $shopid=$shopid;
        $array=[];
        $shopinfo= $info->where('shop_id='.$shopid)->field('shop_name,intro,shop_addr,shop_logo')->find();
        $commet=M('comment');
        $star= $commet->where('shop_id='.$shopid)->avg('star');
        $actinfo= $info ->join('activity ac on ac.shop_id=shop.shop_id')->field('act_id,theme')->where('shop.shop_id='. $shopid)->order('gene_time')->select();
        $array['shop']=$shopinfo;
        $array['shop']['star']=$star;
        $array['shop']['act']=$actinfo;
        return $array ;
    }


}